package cn.highedu.spring.bean;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TransferServiceImpl implements TransferService{

    AccountRepository accountRepository;

    public TransferServiceImpl(){
    }

    @Autowired
    public TransferServiceImpl(AccountRepository accountRepository){
        this.accountRepository = accountRepository;
    }

    public void transfer(int money){
        System.out.println("转账："+money);
    }

    @Override
    public void setAccountRepository(AccountRepository accountRepository) {
        this.accountRepository = accountRepository;
    }

    @Override
    public AccountRepository getAccountRepository() {
        return accountRepository;
    }
}
